import React, { Component } from 'react'
import PubSub from 'pubsub-js'
import Son from './Son'
import Son1 from './Son1'
export default class Far extends Component {
  componentDidMount() {
    // 一般都是在组件挂载成功的时候订阅
    PubSub.subscribe('xxx', (topic, data) => {
      console.log('far', topic, data)
    })
  }
  render() {
    return (
      <div>
        <Son></Son>
        <Son1></Son1>
      </div>
    )
  }
}
